/*
 * This file is part of Sparwe.
 *
 *  Sparwe is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sparwe is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sparwe.  If not, see <http://www.gnu.org/licenses/>.
 */ 


#ifndef __EXCEPTIONS_H__
#define __EXCEPTIONS_H__

#include <exception>
#include <execinfo.h>
#include <string>
#include <vector>
#include <boost/foreach.hpp>


namespace sp_core
{
	class Exception : public std::exception
	{
		public:
			Exception();
			Exception(std::string message);

			virtual ~Exception() throw();

			virtual const char* what();
			const char* What();
			std::vector<std::string> Backtrace();

		protected:
			 std::string mMessage;

	};
	
	class IOException : public Exception
	{
		public:

			IOException() : Exception() {}

			IOException(std::string message) : Exception(message) {}

	};

	class BadCastException : public Exception
	{
		public:
			BadCastException() : Exception() {}
			BadCastException(std::string message) : Exception(message) {}
	};
};


#endif
